package org.aepscolombia.platform.models.entity;
// Generated Jan 13, 2014 2:36:33 PM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * Privileges generated by hbm2java
 */
@Entity
@Table(name="privileges"
    ,catalog="madr_bd10"
)
public class Privileges  implements java.io.Serializable {


     private Integer idPri;
     private String routePri;
     private String namePri;
     private String descriptionPri;
     private Set profileses = new HashSet(0);

    public Privileges() {
    }

	
    public Privileges(String routePri, String namePri, String descriptionPri) {
        this.routePri = routePri;
        this.namePri = namePri;
        this.descriptionPri = descriptionPri;
    }
    public Privileges(String routePri, String namePri, String descriptionPri, Set profileses) {
       this.routePri = routePri;
       this.namePri = namePri;
       this.descriptionPri = descriptionPri;
       this.profileses = profileses;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_pri", unique=true, nullable=false)
    public Integer getIdPri() {
        return this.idPri;
    }
    
    public void setIdPri(Integer idPri) {
        this.idPri = idPri;
    }
    
    @Column(name="route_pri", nullable=false, length=250)
    public String getRoutePri() {
        return this.routePri;
    }
    
    public void setRoutePri(String routePri) {
        this.routePri = routePri;
    }
    
    @Column(name="name_pri", nullable=false, length=50)
    public String getNamePri() {
        return this.namePri;
    }
    
    public void setNamePri(String namePri) {
        this.namePri = namePri;
    }
    
    @Column(name="description_pri", nullable=false, length=250)
    public String getDescriptionPri() {
        return this.descriptionPri;
    }
    
    public void setDescriptionPri(String descriptionPri) {
        this.descriptionPri = descriptionPri;
    }
@ManyToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    @JoinTable(name="profiles_privileges", catalog="madr_bd10", joinColumns = { 
        @JoinColumn(name="id_privilege_pro_pri", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="id_profile_pro_pri", nullable=false, updatable=false) })
    public Set getProfileses() {
        return this.profileses;
    }
    
    public void setProfileses(Set profileses) {
        this.profileses = profileses;
    }




}


